<template>
        <el-card class="box">
      <PageHeader>
        <!--查询form-->
        <div>
          <el-form  inline>
            <el-form-item label="回复状态">
              <el-select
                  v-model="statusCache"
                  placeholder="请选择审核状态"
                  style="width: 200px"
                  clearable
                  filterable
              >
                <el-option
                v-for="item in statusDict_admin"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"                
                />
              </el-select>
            </el-form-item>
            <el-form-item>
            <ElButton  type="primary" @click="handleQuery">查询</ElButton>
        </el-form-item>
          </el-form>
        </div>
        
      </PageHeader>

      <div class="container">
          <div class="comment-list">
            <SystemCommentReplyItem ref="commentList" :userInfo="userInfo" :isCheck="statusCache"  />
          </div>
      </div>
    </el-card>
    </template>

<script>
import SystemCommentReplyItem from '@/components/comment/SystemCommentReplyItem.vue';
import { useUserStore } from "@/store";
export default {
  components: {
    SystemCommentReplyItem,
  },
  data() {
    return {
      userInfo: null,
      statusCache: 0,
      statusDict_admin: [
        { value: 0, label: '未回复' },
        { value: 1, label: '已回复' }
      ],
    };
  },
  created() {
    this.userInfo = useUserStore();
  },
  methods: {
    handleQuery(){
        this.$refs.commentList.fetchComments();
    }
  },
};
</script>